#include "shell.h"
#include <stm32f1xx_hal.h>
#include "usart.h"
#include "shell_port.h"
#include "lcd.h"


Shell shell;
char shell_buffer[512];


signed short User_Shell_Write(char * val, unsigned short len)
{
		//LCD_shell_show(val, len);
		HAL_UART_Transmit(&huart1, (uint8_t*)val, len,0XFFFF);
		StarGuiLcd(val,len);		
		return len;
}

signed short User_Shell_Read(char * val, unsigned short len)
{
		HAL_StatusTypeDef Uart;
		Uart = HAL_UART_Receive_IT(&huart1, (uint8_t*)val, len);
				
		return Uart;
}

void User_Shell_Init(void)
{
		shell.read = User_Shell_Read;
    shell.write = User_Shell_Write;
    shellInit(&shell, shell_buffer, 512);
}
